<?php
//整数的多种表示形式
echo 12345,"\n";//10进制的整数
echo 0b1011,"\n";//2进制整数，以0b开头，后跟0-1数字
echo 567,"\n";//10进制的整数
echo 0o567,"\n";//8进制整数，以0o开头，后跟0-7数字
echo 0x2AF,"\n";//16进制整数，以0x开头，后跟0-9，A-F A=10，B=11,C=12,D=13,E=14,F=15
//算数运算符
echo 18%5,"\n";//18除以5的余数
echo @(18.9%5.8),"\n";//%两边的数据会转换为整数，18除以5的余数
echo 3**2,"\n";//3的2次方
//运算符的优先级
echo 5-6*2,"\n";//*的优先级比-高
//运算符的结合性
echo 8/4*2,"\n";//从左向右计算，结合方向为左
echo -3**2,"\n";//从右向左计算，结合方向为右
echo (-3)**2,"\n";//()的优先级是最高的
//不同类型数据间的算数运算
echo '2000'+123,"\n";
echo 123+'2000',"\n";
echo '2000'+'123',"\n";
echo 2000+'0123',"\n";//不识别2、8、16进制
echo 2000+'-123',"\n";//可以识别正负号
echo 2000+'+123',"\n";
echo 2000+'123aaa',"\n";//只识别数字，从第一个不是数字的地方开始不识别
//echo 2000+'aaaa',"\n";//一开始就是非法数字，无法计算
echo 2000+'2e2',"\n";//科学计数法，'2e2'就是200
echo 2000+NULL,"\n";//null就是0
echo 2000+true,"\n";//true就是1
echo 2000+false,"\n";//false就是0